#!/usr/bin/env ruby
#
#  Created by sjavey on 2007-07-07.
#  Copyright (c) 2007. All rights reserved.

require 'rexml/document'

module N19GPX
  class Bounds
  
    attr_reader :minlat
    attr_reader :minlon
    attr_reader :maxlat
    attr_reader :maxlon
  
    def initialize(boundsElement)
      @minlat = boundsElement.attribute("minlat")
      @minlon = boundsElement.attribute("minlon")
      @maxlat = boundsElement.attribute("maxlat")
      @maxlon = boundsElement.attribute("maxlon")
    end
  
    def javascript
      str = <<EOS
    
    function N19_Bounds(mlat, mlon, xlat, xlon) {
      this.minlat = mlat;
      this.minlon = mlon;
      this.maxlat = xlat;
      this.maxlon = xlon;
    }
EOS
    end
  end
end